﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "OtherWorldPlayerController.generated.h"

struct FInputActionValue;
class UInputAction;
class UInputMappingContext;
/**
 * 
 */
UCLASS()
class OTHERWORLD_API AOtherWorldPlayerController : public APlayerController
{
	GENERATED_BODY()
	
public:
	AOtherWorldPlayerController();
	virtual void PlayerTick(float DeltaTime) override;
protected:
	//添加玩家初始化方法和输入绑定
	virtual void BeginPlay() override;
	virtual void SetupInputComponent() override;
private:
	UPROPERTY(EditAnywhere,Category="Input")
	TObjectPtr<UInputMappingContext> OtherWorldContext;
	UPROPERTY(EditAnywhere,Category="Input")
	TObjectPtr<UInputAction> MoveAction;

	FHitResult CursorHit;//鼠标点击位置，光标检测射线的命中目标
	void Move(const FInputActionValue& InputActionValue);
	void CursorTrace();
};
